package cn.getech.data.development.model.vo;

import cn.getech.data.development.entity.flink.FlinkNodeUnion;
import com.alibaba.fastjson.JSONObject;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.google.common.collect.Lists;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.io.Serializable;
import java.time.LocalDateTime;
import java.util.Date;
import java.util.List;

@Data
@ApiModel(value = "实时任务")
public class RealTimeTaskVO implements Serializable {

    private static final long serialVersionUID = 1L;

    @ApiModelProperty("记录id")
    private Integer id;

    @ApiModelProperty("目录id")
    private Integer menuId;

    @ApiModelProperty("任务名称")
    private String taskName;

    /**
     * 任务类型，关联枚举类:RealTimeTaskType
     * @see cn.getech.data.development.constant.Constant.RealTimeTaskType#
     */
    @ApiModelProperty("任务类型")
    private Integer taskType;

    @ApiModelProperty("资源id")
    private Integer resourceId;
    @ApiModelProperty("资源名称")
    private String resourceName;

    @ApiModelProperty("main函数")
    private String mainFunction;

    @ApiModelProperty("参数项")
    private String mainArgs;

    @ApiModelProperty("并行度")
    private Integer parallelism;

    @ApiModelProperty("工作内存")
    private Integer jobManagerMemory;

    @ApiModelProperty("任务内存")
    private Integer taskManagerMemory;

    @ApiModelProperty("任务个数")
    private Integer taskManagerCount;

    @ApiModelProperty("插槽数")
    private Integer slot;

    @ApiModelProperty("HDFS地址")
    private String savepointPath;

    @ApiModelProperty("检查状态 0 未检查 1 检查成功 2 检查失败")
    private Integer check;

    @ApiModelProperty("检查结果")
    private String checkResult;


    @ApiModelProperty("检查结果")
    private JSONObject checkResultJson;

    @ApiModelProperty("运行状态，0：未运行")
    private Integer runState;

    @ApiModelProperty("锁定状态，1：锁定，0：解锁")
    private Integer lockState;

    @ApiModelProperty("taskManager容器标识")
    private String applicationId;

    @ApiModelProperty("作业运行标识")
    private String jobId;

    @ApiModelProperty("编辑用户id")
    private Integer updatePer;
    @ApiModelProperty("编辑用户名")
    private String updatePerName;

    @ApiModelProperty("运行时间")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private Date runTime;

    @ApiModelProperty("更新时间")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private LocalDateTime updateTime;

    @ApiModelProperty("flinkSQL")
    private String flinkSQL;

    @ApiModelProperty("flinkSQL DAG 任务节点信息")
    private List<FlinkTaskNodeVO> nodeList = Lists.newArrayList();
    @ApiModelProperty("节点关联信息")
    List<FlinkNodeUnion> lineList=Lists.newArrayList();

    private String allSql;

    @ApiModelProperty("前段配置缓存")
    private JSONObject config;

    @ApiModelProperty(value = "项目id")
    private Long procId;

    private String jarUploadUser;
    private Date uploadTime;
    private Integer runLogId;
    private String queenName;
}
